@echo off

IF EXIST Deployment (rmdir Deployment /S /Q)
md Deployment
IF ERRORLEVEL 1 goto error

C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe src\GraphIt\GraphIt.csproj /p:Configuration=Release /t:Rebuild
IF ERRORLEVEL 1 goto error

C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe Samples\Samples.sln /p:Configuration=Debug /t:Clean
IF ERRORLEVEL 1 goto error
C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe Samples\Samples.sln /p:Configuration=Release /t:Clean
IF ERRORLEVEL 1 goto error
IF EXIST "Deployment\SamplesSource" (rmdir /S /Q "Deployment\SamplesSource")
md "Deployment\SamplesSource"
xcopy Samples\*.* Deployment\SamplesSource /S /I

C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe Samples\Samples.sln /p:Configuration=Release /t:Rebuild
IF ERRORLEVEL 1 goto error

exit

:error
pause
exit